package cn.web.tunnelrobot.controller;

import cn.web.tunnelrobot.annotation.Log;
import cn.web.tunnelrobot.enums.BusinessType;
import cn.web.tunnelrobot.service.OperLogService;
import com.github.xiaoymin.knife4j.annotations.ApiSort;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.HashMap;

@RestController
@RequestMapping("/operlog")
@Api(tags = "日志列表接口")
@ApiSort(value = 9)
public class OperlogController {



    @Autowired
    private OperLogService operLogService;

    @GetMapping("/getLogList")
    @Log(title = "日志列表", businessType = BusinessType.LIST)
    @ResponseBody
    @ApiOperation(value = "操做人，类型，时间，pageNo，pageSize")
    public HashMap<String,Object> getUserList(@RequestParam(required = false) String operName,
                                              @RequestParam(required = false)  String businessType,
                                              @RequestParam(value ="operTime", required = false) String operTime,
                                              @RequestParam(value = "pageNo", defaultValue = "1", required = false) Integer pageNo,
                                              @RequestParam(value = "pageSize", defaultValue = "20", required = false) Integer pageSize){
        return operLogService.getLogList(operName,businessType,operTime,pageNo,pageSize);
    }


}
